import request from "@/utils/request.js";
import Cache from "@/utils/cache.js"
const url = '/salesman'


/**
 * 修改头像
 */
export function editAvatar(data) {
  return request.post(url + `/updateAvatar?avatar=${data.avatar}`);
}

/**
 * 获取手机号验证码
 */
export function editPhoneSendMsm(data) {
  return request.post(url + `/updateContactPhoneSendMsm?contactPhone=${data.contactPhone}`);
}

/**
 * 业务员小程序 客户管理 分页查询客户与公司的关联相关信息
#108473643

 */
export function pageCustomerManageBySalesmanId(data) {
  return request.post(url + '/customerCentre/pageCustomerManageBySalesmanId', data);
}

/**
 * 修改邮箱
 */
export function editEmail(data) {
  return request.post(url + `/updateEmail?email=${data.email}`);
}

/**
 * 修改二维码
 */
export function editWechatQrCode(data) {
  return request.post(url + `/updateWechatQrCode?wechatQrCode=${data.wechatQrCode}`);
}

/**
 * 修改个人简历
 */
export function editResume(data) {
  return request.post(url + `/updateResumeBody`, data);
}

/**
 * 二维码
 */
export function getMiniCodeTest(data) {
  return request.post(url + `/wechat/getMiniCode`, data);
}

/**
 * 根据id 且不用token获取编辑名片信息
 */
export const noTokenbusinessCard = (id) => {
  return request.get(url + `/open/getBusinessCardByIdNoToken/${id}`)
}

/**
 * 业务员小程序 客户管理 查询本周新增和本月新增客户数量
 */
export const newCustomerNum = (salesmanId) => {
  return request.get(url + `/customerCentre/queryNewCustomerNum/${salesmanId}`)
}

//查询佣金记录列表列表
export function popularizeInfo(data) {
  return request.post(`/customer/popularize_info_salesman/list`, data);
}

//查询佣金记录 结算与未结算共多少分
export const settlementAmount = (data) => {
  return request.get(`/customer/popularize_info_salesman/settlementAmount`, data)
}
// 获取会议服务人员分页
// POST / meetingServiceStaff / page
// 接口ID：234538041
// 接口地址：https://app.apifox.com/link/project/1304221/apis/api-234538041
export function meetingServiceStaffList(data) {
  return request.post(url + `/meetingServiceStaff/page`, data);
}
// 创建会议服务人员
// POST / meetingServiceStaff / create
// 接口ID：234538039
// 接口地址：https://app.apifox.com/link/project/1304221/apis/api-234538039
export function create(data) {
  return request.post(url + `/meetingServiceStaff/create`, data);
}
export function deletep(id) {
  return request.post(url + `/meetingServiceStaff/delete/${id}`);
}

export function removeCustomer(customerId) {
  return request.post(url + `/customerCentre/removeCustomer/${customerId}`);
}